<?php

$module = isset($_GET['m'])?$_GET['m']:'home';
$controller = isset($_GET['c'])?$_GET['c']:'Index';
$action  = isset($_GET['a'])?$_GET['a']:'Index';

define("MODULE", $module);
define("CONTROLLER", $controller);
define("ACTION", $action);

spl_autoload_register('myload');
// var_dump($$controller,$action);die;
$classlist =array(
   'f'=>'./framework/f.class.php',
   'model'=>'./framework/model.class.php',
   'MySqlDB'=>'./framework/mysqldb.class.php',
   'Controller'=>'./framework/Controller.class.php',
   'Smarty'=>'./framework/lib/smarty/Smarty.class.php',
	);
function myload($class){

	GLOBAL $classlist;
	if(isset($classlist[$class])){
		require_once $classlist[$class];
	}elseif (substr($class, -10)=='controller') {
		require_once './app/'.MODULE.'/controller/'.$class.'.class.php';
	}elseif (substr($class, -5)=='model') {
		require_once './app/'.MODULE.'/model/'.$class.'.class.php';
	}
	/*var_dump($class);*/
}


$con = $controller.'controller';
$match = new $con();
$match->$action();

?>